From: Jyrki Gadinger Date: Tue, 18 Feb 2025 10:53:38 +0000 (+0100) Subject: add a button to open the browser if TOS need to be signed X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~44^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=f19a79a24d5e36c901289809127d48beacf5a801;p=nextcloud-desktop.git add a button to open the browser if TOS need to be signed Signed-off-by: Jyrki Gadinger --- diff --git a/src/gui/tray/SyncStatus.qml b/src/gui/tray/SyncStatus.qml index b482c5586..fa106f96c 100644 --- a/src/gui/tray/SyncStatus.qml +++ b/src/gui/tray/SyncStatus.qml @@ -119,4 +119,15 @@ RowLayout { enabled: visible onClicked: NC.Systray.createResolveConflictsDialog(activityModel.allConflicts); } + + Button { + Layout.rightMargin: Style.trayHorizontalMargin + + text: qsTr("Open browser") + + visible: NC.UserModel.currentUser.needsToSignTermsOfService + enabled: visible + + onClicked: NC.UserModel.openCurrentAccountServer() + } } diff --git a/src/gui/tray/usermodel.cpp b/src/gui/tray/usermodel.cpp index b24ae990d..01260f275 100644 --- a/src/gui/tray/usermodel.cpp +++ b/src/gui/tray/usermodel.cpp @@ -1130,6 +1130,11 @@ bool User::isConnected() const return (_account->connectionStatus() == AccountState::ConnectionStatus::Connected); } +bool User::needsToSignTermsOfService() const +{ + return _account->connectionStatus() == AccountState::ConnectionStatus::NeedToSignTermsOfService; +} + bool User::isDesktopNotificationsAllowed() const { diff --git a/src/gui/tray/usermodel.h b/src/gui/tray/usermodel.h index 3f2170ab0..2d56f0121 100644 --- a/src/gui/tray/usermodel.h +++ b/src/gui/tray/usermodel.h @@ -61,6 +61,7 @@ class User : public QObject Q_PROPERTY(QString featuredAppAccessibleName READ featuredAppAccessibleName NOTIFY featuredAppChanged) Q_PROPERTY(QString avatar READ avatarUrl NOTIFY avatarChanged) Q_PROPERTY(bool isConnected READ isConnected NOTIFY accountStateChanged) + Q_PROPERTY(bool needsToSignTermsOfService READ needsToSignTermsOfService NOTIFY accountStateChanged) Q_PROPERTY(UnifiedSearchResultsListModel* unifiedSearchResultsListModel READ getUnifiedSearchResultsListModel CONSTANT) Q_PROPERTY(QVariantList groupFolders READ groupFolders NOTIFY groupFoldersChanged) @@ -71,6 +72,7 @@ public: [[nodiscard]] AccountStatePtr accountState() const; [[nodiscard]] bool isConnected() const; + [[nodiscard]] bool needsToSignTermsOfService() const; [[nodiscard]] bool isCurrentUser() const; void setCurrentUser(const bool &isCurrent); [[nodiscard]] Folder *getFolder() const;